package com.li.springbootproject.spring.order;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/22/2022 8:32 AM
 */
@Component
public class OrderTestTwo implements ApplicationRunner, Ordered {

    private static final Logger logger = LoggerFactory.getLogger(OrderTestTwo.class);

    /**
     * 执行
     *
     * @param args 参数
     * @throws Exception
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.info("OrderTestTwo...");
    }

    /**
     * 定义执行的顺序
     *
     * @return int
     */
    @Override
    public int getOrder() {
        return 2;
    }
}
